package com.jinxiangyang.gateway.handler;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.web.reactive.error.ErrorWebExceptionHandler;
import org.springframework.core.Ordered;
import org.springframework.lang.NonNullApi;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.server.WebExceptionHandler;
import reactor.core.publisher.Mono;


/**
 * ErrorWebExceptionHandler
 * WebExceptionHandler
 * public interface ErrorWebExceptionHandler extends WebExceptionHandler {
 *     // 扩展网关特有的错误处理能力
 * }
 * 异常处理
 */
@Component
@Slf4j
public class GateWayWebExceptionHandler implements ErrorWebExceptionHandler, Ordered {
    @Override
    public int getOrder() {
        return 0;
    }

    @Override
    public Mono<Void> handle(ServerWebExchange exchange, Throwable ex) {
        return null;
    }
}
